<template>
  <n-alert title="注意" type="warning"> 因为角度制换算问题，反向换算度(°)会存在精度问题（暂未处理） </n-alert>
  <ConvertLayout :standard="standard" :initial="initial" :selectOptionsList="selectOptionsList" />
</template>

<script setup lang="ts">
import ConvertLayout from "../layout/ConvertLayout.vue";

// 光强换算的标准
const standard = {
  label: "度(°)",
  value: 1,
};
// 光强换算的初始值
const initial = {
  label: "弧度(rad)",
  value: 0.0175,
};

// 进制换算的数值类型
const selectOptionsList: ConvertOptionsType = [
  {
    type: "group",
    label: "公制",
    key: "公制",
    children: [
      {
        label: "圆周(circle)",
        value: "圆周(circle)",
        num: 0.00278,
        disabled: false,
      },
      {
        label: "直角",
        value: "直角",
        num: 0.0111,
        disabled: false,
      },
      {
        label: "百分度(gon)",
        value: "百分度(gon)",
        num: 1.11,
        disabled: false,
      },
      {
        label: "度(°)",
        value: "度(°)",
        num: 1,
        disabled: false,
      },
      {
        label: "分(′)",
        value: "分(′)",
        num: 60,
        disabled: false,
      },
      {
        label: "秒(“)",
        value: "秒(“)",
        num: 3600,
        disabled: false,
      },
      {
        label: "弧度(rad)",
        value: "弧度(rad)",
        num: 0.0175,
        disabled: false,
      },
      {
        label: "毫弧度(mrad)",
        value: "毫弧度(mrad)",
        num: 17.45,
        disabled: false,
      },
    ],
  },
  {
    type: "group",
    label: "角度制",
    key: "角度制",
    children: [
      {
        label: "毫秒(mas)",
        value: "毫秒(mas)",
        num: 3600000,
        disabled: false,
      },
      {
        label: "微秒(μas)",
        value: "微秒(μas)",
        num: 3.6e9,
        disabled: false,
      },
    ],
  },
];
</script>
